package day4.作业1026.作业07;

public class Sanjx extends Image{
    private double bian1;
    private double bian2;
    private double bian3;

    public Sanjx( double bian1, double bian2, double bian3) {
        this.bian1 = bian1;
        this.bian2 = bian2;
        this.bian3 = bian3;
    }


    @Override
    public void mianji() {
        double p=(bian1+bian2+bian3)/2;
        double mj =Math.sqrt(p*(p-bian1)*(p-bian2)*(p-bian3));
        System.out.println("三角形面积"+mj);
    }

    @Override
    public void zhouchang() {
     double zc = bian1+bian2+bian3;
        System.out.println("三角形周长为"+zc);
    }
}
